home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / 1svga.zip / VMODE.PAS < prev    next >
Pascal/Delphi Source File  |  1994-04-27  |  2KB  |  70 lines

  1. { Set Video Mode for ET4000 }
  2.  
  3. uses Txt;
  4.  
  5. { ─────────────── SetVideoMode ─────────────── }
  6. procedure SetVideoMode(X,Y:integer);    { 55x18 }
  7. const
  8.   Mode:array[0..23] of byte=(
  9.     $01,$03,$05,$06,$07,$0D,$0E,$0F,$10,$11,$12,$13,
  10.     $22,$23,$24,$26,$29,$2A,$2D,$2E,$2F,$30,$37,$38);
  11.   St:array[0..23] of string[19]=(
  12.     'Text   40x 25,  16C','Text   80x 25,  16C',
  13.     'CGA   320x200,   4C','CGA   640x200,   2C',
  14.     'Text   80x 25, Mono','EGA   320x200,  16C',
  15.     'EGA   640x200,  16C','EGA   640x350,   2C',
  16.     'EGA   640x350,  16C','VGA   640x480,   2C',
  17.     'VGA   640x480,  16C','VGA   320x200, 256C',
  18.     'Text  132x 44,  16C','Text  132x 25,  16C',
  19.     'Text  132x 28,  16C','Text   80x 60,  16C',
  20.     'SVGA  800x600,  16C','Text  100x 40,  16C',
  21.     'SVGA  640x350, 256C','SVGA  640x480, 256C',
  22.     'SVGA  640x400, 256C','SVGA  800x600, 256C',
  23.     'SVGA 1024x768,  16C','SVGA 1024x768, 256C');
  24. var P,K:integer;
  25.     Buf:pointer;
  26. begin
  27.   if Mem[0:$449]<>3 then begin VideoMode(3); TextMem:=Ptr($B800,0); end;
  28.   GetMem(Buf,4000);
  29.   GetText(X,Y,56,19,Buf^);
  30.   TextWindow1(X,Y,55,18,$17,$17,1,'─');
  31.   TextBar(X+1,Y+2,53,1,$13,'─');
  32.   PrintText(X+4,Y+1,$1F,'VMode for ET4000  (C) 1994 by Jou-Nan Chen');
  33.   for P:=0 to 23 do begin
  34.     PrintText(X+4+25*(P div 12),Y+4+P mod 12,$1B,HexByte(Mode[P]));
  35.     PrintText(X+7+25*(P div 12),Y+4+P mod 12,$1E,St[P]);
  36.   end;
  37.   P:=1;
  38.   repeat
  39.     PrintText(X+3+25*(P div 12),Y+4+P mod 12,$2F,' '+HexByte(Mode[P]));
  40.     PrintText(X+6+25*(P div 12),Y+4+P mod 12,$2E,' '+St[P]+' ');
  41.     K:=Key;
  42.     PrintText(X+3+25*(P div 12),Y+4+P mod 12,$1B,' '+HexByte(Mode[P]));
  43.     PrintText(X+6+25*(P div 12),Y+4+P mod 12,$1E,' '+St[P]+' ');
  44.     case K of
  45.       $4800:Dec(P);    $5000:Inc(P);       { Up,Down }
  46.       $4B00:Dec(P,12); $4D00:Inc(P,12);    { Left,Right }
  47.       $4700:P:=0;      $4F00:P:=23;        { Home,End }
  48.     end;
  49.     if P<0  then Inc(P,24);
  50.     if P>23 then Dec(P,24);
  51.   until (K=$1C0D) or (K=$011B);            { Enter,Esc }
  52.   PutText(X,Y,56,19,Buf^);
  53.   FreeMem(Buf,4000);
  54.   if K=$1C0D then VideoMode(Mode[P]);
  55. end;
  56.  
  57. var V,I:integer;
  58.  
  59. begin
  60.   if ParamCount=0 then SetVideoMode(13,4) else begin
  61.     Val(ParamStr(1),V,I);
  62.     if (ParamCount=1) and (I=0) then VideoMode(V) else begin
  63.       Writeln;
  64.       Writeln('VMode for ET4000  (C) 1994 by Jou-Nan Chen');
  65.       Writeln('Usage: VMode Mode_Number  or  VMode');
  66.       Halt(1);
  67.     end;
  68.   end;
  69. end.
  70.